package cn.wolfcode.trip.web.controller;

import cn.wolfcode.trip.domain.UserInfo;
import cn.wolfcode.trip.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController  //@Controller + @ResponseBody
@RequestMapping("users")
public class UserInfoController {

    @Autowired
    private IUserInfoService userInfoService;

    @GetMapping("list")
    public List<UserInfo> list(){
        final List<UserInfo> list = userInfoService.list();
        return list;
    }
}
